<?php

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
#	FILE:			site_specific/ggw.php
#	FUNCTION:		Formatting the Magnetic Resonance Technology page output
#	AUTHOR:			Cameron Morrow
#	CREATED:		18/09/2005
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# C A N   E D I T ?
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Compact?
$PAGE_COMPACT = (@$_GET["compact"]) ? true : false;

# See if editing
$edit_page = (@$_GET["edit"] == "true" && !$PAGE_PREVIEW) ? true : false;

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# S T A R T   H T M L
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en-AU\" xml:lang=\"en-AU\">\n";
echo "<!-- Created by Cameron Morrow for Zone 4 -->\n";
echo "<head>\n";
echo "\t<title>" . $PROJECT_TITLE . " - " . $PAGE_NAME . "</title>\n";
echo "\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n";
echo "\t<script language=\"javascript\" type=\"text/javascript\" src=\"../site_specific/assets/scripts/tct.js\"></script>\n";
echo "\t<style type=\"text/css\">\n";
echo "\t\t@import url(\"../site_specific/assets/styles/main.css\");\n";
echo "\t</style>\n";
echo "</head>\n";

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# B O D Y
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "<body onload=\"parseImagePopups();\" class=\"" . ($PAGE_COMPACT ? "compact" : ($IS_SHOWING_LOGIN ? "login" : "")) . "\">\n";

# Start container
echo "<div id=\"container\">";

	# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	# H E A D E R
	# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	echo "<div id=\"header\">";
		
	echo "<a href=\"../site/index.php\"><img src=\"../site_specific/assets/images/site/logo.png\" style=\"height:200px\" border=0/></a>";
	
	echo "<h1>" . $PROJECT_TITLE . " - " . $PAGE_NAME . "</h1>\n";
	
	echo "</div>";

	# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	# N A V I G A T I O N
	# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	echo "<div id=\"nav\">\n";
	echo "<ul class=\"nav\">\n";

	# Top level pages
	$top_level_pages = $PAGES -> getChildrenOfPage("");
	
	# If navigation items found
	if (count($top_level_pages) > 0) {

		$counter = 0;

		# For each
		foreach ($top_level_pages -> getPageIDs() as $nav_page_id) {

			# Get page details
			$nav_page = $top_level_pages -> getPage($nav_page_id);

			# Get list of groups authorized to view this page
			$nav_page_authorized = explode(",", $nav_page -> getData("p_access"));
			
			# Get List of groups of users
			$nav_group_authorized= explode(",", $USER -> getGroup());

			# Ensure it can be viewed at current authorization
			$nav_page_authorized = (findArrayInArray($nav_page_authorized, $nav_group_authorized) !== false);

			# Ensure it's in the navigation
			$nav_page_in_navigation = ($nav_page -> getData("p_innavigation") == "1");

			# Get class for <li> item
			$item_class = ($nav_page -> getID() == $PAGES -> getPageAtDepth($PAGE_ID, 0)) ? array("active") : array();

			# Is first?
			if ($counter == 0) $item_class[] = "first";

			if ($nav_page_authorized && $nav_page_in_navigation) {

				$menu_item=explode("-",$nav_page -> getData("p_name"));
				# Open nav item
				echo "<li class=\"" . implode(" ", $item_class) . "\"><a href=\"../" . $nav_page -> getData("p_section") . "/" . $nav_page -> getID() . ".php\">" . $menu_item[0]. "</a></li>";

				$counter++;
			}
		}
	}

	# Close navigation
	echo "</ul>\n";
	echo "</div>";
	
	# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	# M A I N   C O N T E N T
	# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	$sidebar_content = getRecord("SELECT p_id, p_content FROM " . $PROJECT_DB_TABLES["pages"] . " WHERE p_id = 'maps' OR p_id = 'must_see' OR p_id = 'must_do' OR p_id = 'plan_your_trip'", "p_id");

	$failure_content = "<p>Content missing!</p>";

	$content = array();
	$content["maps"] = $failure_content;
	$content["must_see"] = $failure_content;
	$content["must_do"] = $failure_content;
	$content["plan_your_trip"] = $failure_content;

	if ($sidebar_content) {

		foreach ($content as $key => $value) {

			if (isset($sidebar_content[$key]) && $sidebar_content[$key]["p_content"] != "") {
				$value = parseFlashLinks(parseFlashXML($sidebar_content[$key]["p_content"]));
				$index = strpos($value, "textcontainer");
				if ($index !== false) {
					$value = substr($value, strpos($value, ">", $index) + 1);
					$value = substr($value, 0, strpos($value, "</td>"));
					$value = preg_replace(
						array("/<[^>]*>/i"),
						array(""),
						$value);

					if (strlen($value) > 150) {
						$value = substr($value, 0, 147) . "...";
					}
					$value = "<p>" . $value . "</p><p><a href=\"../site/" . $key . ".php\">More &raquo;</a></p>";
				} else {
					$value = $failure_content;
				}
			}
			$content[$key] = $value;
			
		}
	}
	//$sqlscript="select * from apollo_pages where p_parent="."\"".$PAGE_ID."\" AND p_status<3 order by p_sort ";
	//$current_data=getRecord($sqlscript,"p_id");
	
	echo "<div id=\"maincontent\">\n";
	echo "<div id=\"maincontentleft\">\n";
	
	//echo "<ul id=\"verticalmenu\">";
	
	$flag_list_end = false; //this flag is used to judge whether the list will be ended or not.
	
	$content_left_side = '';
	
	//print_r($top_level_pages);
	
		
	$page_path = $PAGES -> getPathToPage($PAGE_ID);
	
	echo "<br/>";
	
	IterationList($top_level_pages);
	
	echo $content_left_side;
	
	echo "</div>";
	
	$FLAG_TOP_LEVEL=false;
	
	  if(in_array($PAGE_ID,array("mres_7014","mres_7005","mres_7007","mres_7009","mres_7016","mres_7008","mres7100","mres_7001","mres_7002","mres_7003","mres_7004","mres_7006"))){
			$FLAG_TOP_LEVEL=true;
	  }
	  
	  # RIGHT
	  echo "<div id=\"maincontentright\" style=\"font-family:Arial;\">" .
		  contentHeader($PAGE_NAME,$PAGE_ID,$FLAG_TOP_LEVEL) .
		  startContentBox() .
		  "<div class=\"cw\">";

		  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		  # P A G E   C O N T E N T
		  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		  if(($PAGE_ID=='image' || $PAGE_ID=='video') && $USER -> getCanApprove()){
			  
			// $main_output = "a hahahahahah";
			  
			  $image_page_content ='';
			  
			  GenerateImageForm();
			  
			 $main_output = $image_page_content;
		  }
		  # Primary Output
		  else if (($PAGE_ID!='image' && $PAGE_ID!='video') && ($edit_page && $USER -> getCanApprove())) {

			  # Width?
			  if ($PAGE_COMPACT) {
				  $width = 670;
				  $height = 400;
			  } else {
				  $width = 520;
				  $height = 600;
			  }

			  # Flash editor
			  $main_output = "<p>" . generatePageEditFlash("../assets/flash/editor3_02.swf?host=../&passed_width=" . $width . "&passed_height=" . $height . "&page=" . $PAGE_ID . "&type=page", $width, $height) . "</p>";
		  } 
		  else {

			  if (!isset($main_output)) {
				  
				  //echo $PAGE_CONTENT;
				  			  	
				  # Prep content
				  $main_output = parseFlashLinks(parseFlashXML($PAGE_CONTENT));	
				  
				  if($USER -> getCanApprove()){
				  
					  $main_output .= "<hr/>";
					  
					  $current_page_parent = $PAGE -> getData("p_parent");
					  
					  $data_tags = array();
					  
					  if($current_page_parent == 'blog'){
						  
						  $sql_tags = "SELECT DISTINCT t_tag FROM ".$PROJECT_DB_TABLES["tags"]." order by t_tag";
						  
						  $sql_selected_tags = "SELECT DISTINCT t_tag FROM ".$PROJECT_DB_TABLES["blogtag"]." bt JOIN ".$PROJECT_DB_TABLES["blogs"]." b ON b.b_index = bt.bt_blog JOIN ".$PROJECT_DB_TABLES["tags"]." t ON bt.bt_tag = t.t_index WHERE b_id=\"".$PAGE_ID."\"";
						  
						  #Get the data result
						  $data_tags = getRecord($sql_tags);
						  
						  $data_selected_tags = getRecord($sql_selected_tags);
						  
						  $main_output .="<div id=\"div_selected_tags\">";
														  
						  foreach($data_tags as $tag_keys =>$tag_values){
									
								if(in_array($tag_values, $data_selected_tags)){
									
									$main_output.= "&nbsp;&nbsp;".$tag_values["t_tag"].":<input type=\"checkbox\" id=\"".$tag_values["t_tag"]."\" name=\"".$tag_values["t_tag"]."\" value=\"".$tag_values["t_tag"]."\" onchange=\"saveTags('".$tag_values["t_tag"]."','".$PAGE_ID."')\" checked=\"checked\" />";
								}
								else{
									
									$main_output.= "&nbsp;&nbsp;".$tag_values["t_tag"].":<input type=\"checkbox\" id=\"".$tag_values["t_tag"]."\" name=\"".$tag_values["t_tag"]."\" value=\"".$tag_values["t_tag"]."\" onchange=\"saveTags('".$tag_values["t_tag"]."','".$PAGE_ID."')\" />";
								}
						  } 
						  
						  $main_output .="</div>";
						  
						  $main_output .="<div id=\"div_notice\"></div>"; 
						  
						  $main_output .= "<br/><br/>&nbsp;&nbsp;Add Tag: <input type=\"text\" id=\"new_tag\"/><input type=\"button\" onclick=\"addTags('".$PAGE_ID."')\" value=\"Add\"/>";
					  
					 	  $main_output .= "<br/><br/>&nbsp;&nbsp;Delete Tag: <select id=\"select_delete_tag\">";
					  
					  	  foreach($data_tags as $data_tags_values){
						  
						  	$main_output.= "<option value=\"".$data_tags_values["t_tag"]."\">".$data_tags_values["t_tag"]."</option>";
					  	  }
					  
					  	  $main_output .= "</select><input type=\"button\" onclick=\"deleteTags('".$PAGE_ID."')\" value=\"Delete\"/>";
					  }   				 
				  }
			  }
		  }

		  # ASK IF EDITING
		  if ($USER -> getCanApprove() && !$PAGE_COMPACT && !$PAGE_PREVIEW) {
			  echo "<div class=\"canedit\">";
			  
			  if(($PAGE_ID!='image' && $PAGE_ID!='video')){
				  
				  if (!$edit_page) {
					  echo "<form name=\"edithispageform\" id=\"editthispageform\" action=\"" . $PAGE_ID . ".php\" method=\"get\">";
					  echo "<p>As an administrator you can <input type=\"hidden\" name=\"edit\" id=\"edit\" value=\"true\" />";
					  echo "<input type=\"submit\" value=\"Edit this page\" /></p>";
					  echo "</form>";
					  
				  } 
				  else {
					  echo "<form name=\"edithispageform\" id=\"editthispageform\" action=\"" . $PAGE_ID . ".php\" method=\"get\">";
					  echo "<p>Once you have finished making changes, click <input type=\"hidden\" name=\"edit\" id=\"edit\" value=\"\" />";
					  echo "<input type=\"submit\" value=\"Finished editing\" /></p>";
					  echo "</form>";
				  }
			  }

			  if ($PAGE -> getData("p_custom_content") != "") {
				  echo "<p>Note: This page uses a custom content (<em>" . $PAGE -> getData("p_custom_content") . "</em>), so changes you make may not be reflected in the site proper.</p>";
			  }
			  echo "</div>";
		  }

		  # MESSAGES
		  $messages_output = "";
		  if (count($MESSAGE_ARRAY) > 0) {

			  $messages_output .= "<ul id=\"messages\" class=\"messages\">\n";

			  foreach ($MESSAGE_ARRAY as $message) {
				  $messages_output .= "<li class=\"messagetype" . $message[1] . "\">" . $message[0] . "</li>";
			  }

			  $messages_output .= "</ul>\n";
		  }
		  echo $messages_output;
		  
		  # Fix main output
		  $main_output = str_replace(
			  array("%0a", "%09"),
			  array("", ""),
			  $main_output
		  );

		  # MAIN
		  echo $main_output;


		  # ERRORS
		  if (count($ERROR_ARRAY) > 0 && $SHOW_ERROR_FEEDBACK) {

			  echo "<h2>Errors (" . count($ERROR_ARRAY) . ")</h2>\n";
			  echo "<ul id=\"errors\" class=\"messages\">";

			  foreach ($ERROR_ARRAY as $error) {
				  echo "<li class=\"messagetype" . $error[1] . "\">" . $error[0] . "</li>";
			  }

			  echo "</ul>\n";
		  }

		  # SQL QUERIES
		  if (count($SQL_ARRAY) > 0 && $SHOW_SQL_FEEDBACK) {

			  echo "<h2>SQL Queries (" . count($SQL_ARRAY) . ")</h2>\n";
			  echo "<ul id=\"sqlqueries\" class=\"messages\">";

			  foreach ($SQL_ARRAY as $sql_query) {
				  echo "<li>" . $sql_query . "</li>";
			  }

			  echo "</ul>\n";
		  }

	  echo "</div>" .
		  endContentBox();
	  
	echo "</div>";
  # End main content
  echo "</div>";


	# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	# F O O T E R
	# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	echo "<div id=\"footer\">\n";
	echo "<p>Copyright &copy; Zone4, 2010 | \n";
	if ($USER -> isLoggedIn()) {
		echo "<a href=\"../admin/adminhome.php\">admin</a> | <a href=\"?logout=1\">logout</a> | Logged in as <strong>" . $USER -> getFirstName() . " " . $USER -> getLastName() . "</strong> (" . $USER -> getGroupName() . ")";
	} else {
		echo "<a href=\"../admin/adminhome.php\">admin</a>";
	}
	echo " | v" . $EDITOR_VERSION . "</p>\n";
	echo "<p><a href=\"http://validator.w3.org/check?uri=referer\">XHTML</a> | CSS</p>";
	echo "</div>\n";

# End container
echo "</div>";


echo "<div id=\"popup\" >";//style=\"display: none;background:#EFEFEF;color:#222222;border:solid;border-color:#C0C0C0;width:600px;height:400px;\"
echo "<div id=\"handle\" style=\"\">";
 echo "<form name=\"popupform\" id=\"popupform\" action=\"" . $PAGE_ID . ".php\" method=\"get\">";
 
 echo "</form>";
 echo "</div>";
echo "</div>";

# End
echo "</body>" .
	"</html>";

#Iteration function to generate left side menu	
function IterationList($pages){

	global $PAGE_ID;
	global $content_left_side;
	global $USER;
	global $PAGES;
	global $page_path;
	
	$content_left_side .= "<ul>";
	if(count($pages)>0) {
		
		foreach($pages -> getPageIDs() as $lsm_page_id){
			
			//echo $lsm_page_id."<br/>";
			
			$lsm_page = $pages -> getPage($lsm_page_id);
			
			//print_r($pages);
			
			$lsm_page_authorized = explode(",", $lsm_page -> getData("p_access"));
			
			$lsm_group_authorized = explode(",", $USER -> getGroup());
			
			$lsm_page_authorized = $USER -> isUserAuthorized($PAGES -> getAuthorizedGroups($lsm_page_id));
			
			$lsm_page_in_navigation = ($lsm_page -> getData("p_innavigation") == "1");

			if ($lsm_page_authorized && $lsm_page_in_navigation) {
				
				
				if(in_array($lsm_page_id,$page_path)||$lsm_page_id==$PAGE_ID){
					if($lsm_page_id==$PAGE_ID){
						
						$content_left_side .= "<li><a href=\"../" .$lsm_page -> getData("p_section"). "/" .$lsm_page -> getData("p_id").".php\" style=\"font-family:Georgia,serif;color:#FE2E2E;\">" . $lsm_page -> getData("p_name") . "</a></li>";
					}
					else{
						
						$content_left_side .= "<li><a href=\"../" .$lsm_page -> getData("p_section"). "/" .$lsm_page -> getData("p_id").".php\" style=\"font-family:Georgia,serif;color:#CEE3F6;text-decoration: none;\">" . $lsm_page -> getData("p_name") . "</a></li>";
					}
					$next_level_pages = $PAGES -> getChildrenOfPage($lsm_page_id);
					IterationList($next_level_pages);
				}
				else if($lsm_page_id!=$PAGE_ID&&!in_array($lsm_page_id,$page_path)){
					
					$content_left_side .= "<li><a href=\"../" .$lsm_page -> getData("p_section"). "/" .$lsm_page -> getData("p_id").".php\" style=\"font-family:Georgia,serif;color:#CEE3F6;text-decoration: none;\">" . $lsm_page -> getData("p_name") . "</a></li>";
				}
			}
		}
		
	}
	
	$content_left_side .= "</ul>";
	
}

#generate image form
function GenerateImageForm(){
  
  global $PAGE_ID;
  
  global $image_page_content;
  
  global $FILE_TYPE_NAMES_ARRAY;
  
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # Check for added file
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  if ($_FILES) {
	  
	  # Get file name
	  $uploaddir = "../front/gallery/";
	  
	  $upload_time=0;
	  
	  Foreach($_FILES["uploadfile"]["name"] as $file_name_value){
		  
		  $uploadfile = $uploaddir . basename($file_name_value);
	  
		  # Move to upload directory
		  if (@move_uploaded_file($_FILES["uploadfile"]["tmp_name"][$upload_time], $uploadfile)) {
	  
			  # Was thumbnail created?
			  $thumbnail_created = false;
	  
			  # Extension
			  $extension = substr($_FILES["uploadfile"]["name"][$upload_time], strrpos($_FILES["uploadfile"]["name"][$upload_time], ".") + 1);
	  
			  # Check if JPG
			  if ($extension == "jpg" || $extension == "jpeg") {
	  
				  # Check if creating thumbnail
				  if (@$_POST["createthumbnail"]) {
	  
					  # Create Thumbnail
					  if (createThumbnail($uploaddir, $_FILES["uploadfile"]["name"][$upload_time])) {
						  //addMessage("<p>Thumbnail was created successfully.</p>");
						  $thumbnail_created = true;
					  } else {
						  //addMessage("<p>Sorry, a thumbnail could not be created.</p>", 2);
					  }
				  }
			  }
	  
			  # Message
			 // addMessage("<p>OK, file <em>" . $_FILES["uploadfile"]["name"][$upload_time] . "</em> was added to the uploads directory.</p>");
	  
			  # Log
			 // addLog(basename($_FILES["uploadfile"]["name"][$upload_time]) . "|" . ($thumbnail_created ? "true" : "false"), 17);
	  
		  } else {
	  
			  # Message
			  //addMessage("<p>Sorry, an error occured while uploading the file. Please try uploading the file again.</p>", 2);
	  
		  }
		  
		  $upload_time++;
	  }
  }
  
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # Check for deleted file
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  if (@$_POST["deletefile"]) {
  
	  # File to delete
	  $file_name = $_POST["deletefile"];
  
	  if (deleteFile("../front/gallery", $file_name)) {
  
		  # Message
		 //addMessage("<p>OK, file <em>" . $file_name . "</em> was deleted successfully.</p>");
  
		  # Log
		  //addLog($file_name, 18);
  
	  } else {
  
		  # Message
		  //addMessage("<p>Sorry, an error occured and file <em>" . $file_name . "</em> could not be deleted.</p>", "error");
	  }
  }
  
  # Get list of files
  $file_search = @$_GET["searchfile"] ? $_GET["searchfile"] : "";
  $uploaded_files = getGallaryFiles(true, $file_search);
  
  # Output
  $image_page_content .= "<h2>Search:</h2><form name=\"searchfileform\" action=\"" . $PAGE_ID . ".php\" method=\"get\">" .
	  "<p>Search for file: <input type=\"text\" name=\"searchfile\" size=\"50\" value=\"" . $file_search . "\" /> <input type=\"submit\" value=\"Search\" /> <input type=\"button\" onclick=\"window.location = '" . $PAGE_ID . ".php';\" value=\"View All\" /></p>" .
  "</form>";
  
  # Prep a table properties object for the files
  $data_properties = new TableProperties();
  
  $data_properties -> addCustomColumn("File", "\"<a id=\\\"[filename]\\\" onmouseover=\\\"ShowPics('[filename]')\\\" href=\\\"../front/gallery/[filename]\\\">[filename][thumbnail]</a>\"");
  $data_properties -> addCustomColumn("Size", "formatBytes([size])");
  $data_properties -> addCustomColumn("Action", "\"<a href=\\\"javascript:deleteUploadedFile('[filename]');\\\">Delete</a>\"");
  
  # Get files
  $current_data = array();
  foreach ($uploaded_files as $key => $file_group) {
	  foreach ($file_group as $file_details) {
		  $current_data[] = array("filename" => $file_details["name"],
			  "type" => $FILE_TYPE_NAMES_ARRAY[$key],
			  "size" => $file_details["size"]
		  );
	  }
  }
  
  # Draw the table
  $image_page_content .= $data_properties -> drawBrowseTable($current_data, "Browsing Files", "type", "upload");
  
  $image_page_content .= "<img id=\"display_img\" width=\"300px\" height=\"300px\" />";
  
  # Delete file form
  $image_page_content .= "<div><form name=\"deletefileform\" id=\"deletefileform\" action=\"" . $PAGE_ID . ".php\" method=\"post\">" .
	  "<input type=\"hidden\" name=\"deletefile\" id=\"deletefile\" value=\"\" />" .
	  "</form>";
  
  # Add file form
  $image_page_content .= "<h2 class=\"uploadadd\">Adding a file</h2>" .
	  "<p>Select the file to be added, then click \"Add File\" to upload it:</p>" .
	  "<form name=\"addfileform\" id=\"addfileform\" action=\"" . $PAGE_ID . ".php\" enctype=\"multipart/form-data\" method=\"post\">" .
	  "<p>How many files do you want to upload at the same time? 
	  <select onchange=\"uploadnumber(this.value)\"><option value=\"1\" selected=\"selected\">1</option><option value=\"2\">2</option><option value=\"3\">3</option><option value=\"4\">4</option><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option><option value=\"10\">10</option></select>
	  <div id=\"divfile\" style=\"margin-left:80px;\">
		  <input type=\"file\" name=\"uploadfile[]\" id=\"uploadfile[]\" width=\"300\"/><br/>
	  </div>
	  <div style=\"margin-left:80px;\">
	  <input type=\"checkbox\" id=\"createthumbnail\" name=\"createthumbnail\" /> 
	  <label for=\"createthumbnail\">Create thumbnail (for JPG only)</label> <input type=\"submit\" value=\"Add File\" /></div></p>" .
	  "</form>";
	  
  /*addContent("<div id=\"files_list\"></div><script>var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 3 );multi_selector.addElement( document.getElementById( 'uploadfile' ) );</script>");*/
  
  # Result form
  $image_page_content .= "<form name=\"searchitemform\" id=\"searchitemform\" action=\"" . $PAGE_ID . ".php\" method=\"post\">" .
	  "<input type=\"hidden\" name=\"result\" id=\"result\" value=\"1\" />" .
	  "</form></div>";
}

#generate video form
function GerenateVideoForm(){
}

?>